package IO;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

/**
 * @author wuhan
 * @date 2019/10/13 17:33
 */
public class ByteArrayStreamDemo {
    public static void main(String[] args) {
        ByteArrayInputStream bis=new ByteArrayInputStream("asdsd".getBytes());       ByteArrayOutputStream bos=new ByteArrayOutputStream();
        int by=0;
        while ((by=bis.read())!=-1){
            bos.write(by);
        }

        System.out.println(bos.size());
        System.out.println(bos.toString());
    }
}
